Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LANG/SCHEDULE] Reduction factor, predicate in reduction. #77

Merged
merged 1 commit into from
Mar 29, 2017
Merged

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Mar 29, 2017

Support rfactor that factors reduction into temporal stage and then reduction.

n = tvm.convert(1027)
A = tvm.placeholder((n,), name='A')
k = tvm.reduce_axis((0, n))
B = tvm.compute((1,), lambda i: tvm.sum(A[k], axis=k, where=(i>1)), name='B')
kf = tvm.reduce_axis((0, 4))
# schedule
s = tvm.Schedule(B.op)
_, ki = s[B].split(k, outer=kf)
BF = s.rfactor(B, kf)
s[BF].parallel(BF.op.axis[0])

The original reduction is B = sum(A, axis=1). rfactor changes it two two stage reduction

BF = sum(A.pad_reshape(4,  n/4), axis=1)
B = sum(B, axis=0)

pad_reshape will include predicate to guard that the index won't exceed bound. This allows further manipulation of BF's first factored axis, for example parallelize over the factored dimension

@tqchen tqchen requested a review from ZihengJiang March 29, 2017 04:15
@ZihengJiang
Copy link
Contributor

LGTM

@tqchen tqchen merged commit 6d79877 into master Mar 29, 2017
icemelon pushed a commit to icemelon/tvm that referenced this pull request Apr 14, 2020
MasterJH5574 pushed a commit to MasterJH5574/tvm that referenced this pull request Feb 26, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
MasterJH5574 pushed a commit to MasterJH5574/tvm that referenced this pull request Mar 3, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
jinhongyii pushed a commit to jinhongyii/tvm that referenced this pull request Jun 20, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
Hzfengsy pushed a commit to Hzfengsy/tvm that referenced this pull request Jul 30, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
Kathryn-cat added a commit to Kathryn-cat/tvm that referenced this pull request Aug 4, 2022
* [Feature Extraction] Group 1 Feature

* add python files

* add test file

* fixed bug: order of visiting
Kathryn-cat added a commit to Kathryn-cat/tvm that referenced this pull request Aug 14, 2022
* [Feature Extraction] Group 1 Feature

* add python files

* add test file

* fixed bug: order of visiting
Kathryn-cat added a commit to Kathryn-cat/tvm that referenced this pull request Aug 16, 2022
* [Feature Extraction] Group 1 Feature

* add python files

* add test file

* fixed bug: order of visiting
areusch pushed a commit to areusch/tvm that referenced this pull request Sep 20, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
gigiblender pushed a commit to gigiblender/tvm that referenced this pull request Nov 3, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
MasterJH5574 pushed a commit to MasterJH5574/tvm that referenced this pull request Nov 20, 2022
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
yelite pushed a commit to yelite/tvm that referenced this pull request Feb 17, 2023
* Parse relax TupleGetItem

* Incorporate comments

* fix comment
LeiWang1999 added a commit to LeiWang1999/tvm that referenced this pull request Nov 8, 2024
* Refactor BatchMatMulEmitter and BatchMatMulSelector for improved readability and maintainability

* Refactor import statements for improved readability and maintainability

* Refactor import statements for improved readability and maintainability

* disable failure email for ci

* remove email notifications.

* move relax pass from testing to mlc_llm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants